/* *****************************************************************************
 * JFab (http://code.google.com/p/jfab)
 * Copyright (c) 2011 JFab.org
 * Admin jfab@jeffreythompson.net
 *
 * See the file "LICENSE.txt" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 * *****************************************************************************/

package org.jfab.core.factory;

import java.util.List;
import java.util.Map;

import org.javaruntype.type.Type;
import org.jfab.core.model.CGType;

/**
 * Defines methods required by a code generator type factory.
 */
public interface CGTypeFactory
{
    /**
     * @param aClass Class.
     * 
     * @return a new code generator type.
     */
    CGType createType(Class<?> aClass);

    /**
     * @param type Type.
     * 
     * @return a new code generator type.
     */
    CGType createType(java.lang.reflect.Type type);

    /**
     * @param name Name. (required)
     * 
     * @return a new code generator type.
     */
    CGType createType(String name);

    /**
     * @param packageName Package name.
     * @param importMap Map of simple type name to type.
     * @param className Class name.
     * 
     * @return a new type.
     */
    CGType createType(String packageName, Map<String, CGType> importMap,
            String className);

    /**
     * @param packageName Package name.
     * @param name Name. (required)
     * 
     * @return a new code generator type.
     */
    CGType createType(final String packageName, final String name);

    /**
     * @param packageName Package name.
     * @param name Name. (required)
     * @param typeParameters Type parameters.
     * 
     * @return a new code generator type.
     */
    CGType createType(final String packageName, final String name,
            final List<CGType> typeParameters);

    /**
     * @param type Type.
     * 
     * @return a new code generator type.
     */
    CGType createType(Type<?> type);
}
